package main

import (
	"net/smtp"
	"log"
	"fmt"
)

func main() {
//	for true  {
	ExampleSendMail()		//是否阻塞？
	fmt.Print("send")
//	}
}

func ExampleSendMail() {
	// Set up authentication information.
	auth := smtp.PlainAuth("identity", "249543195@qq.com", "ikadlnkottqgbgfe", "smtp.qq.com")

	// Connect to the server, authenticate, set the sender and recipient,
	// and send the email all in one step.
	to := []string{"18512392972@163.com"}
	msg := []byte("To: recipient@example.net\r\n" +
	"Subject: discount Gophers!\r\n" +
	"\r\n" +
	"This is the email body.\r\n")
	err := smtp.SendMail("smtp.qq.com:25", auth, "249543195@qq.com", to, msg)
	if err != nil {
		log.Fatal(err)
	}
}
